package com.lt.topic;

import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @author lucine
 * @version 1.0 2021/6/20 15:13
 */
@Component
public class TopicCustomer {


    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue,
                    exchange = @Exchange(value = "topics1",type="topic"),
                    key={"user.*","order.*"}
            )
    })
    public void receive1(String message){
        System.out.println("TopicCustomer message1 = "+message);
    }

    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue,
                    exchange = @Exchange(value = "topics1",type="topic"),
                    key={"*.user","order.#",}
            )
    })
    public void receive2(String message){
        System.out.println("TopicCustomer message2 = "+message);
    }

}
